package com.killers.cold.orm.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.killers.cold.orm.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

/**
 * @author 罗天豪
 * @date 2019/9/9
 */
@TableName("ck_user_file")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
public class UserFile extends BaseEntity {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField
    @ApiModelProperty("用户唯一标识")
    @NotEmpty(message = "用户唯一标识不为空")
    @Length(min = 1,max = 50)
    private String userId;

    @TableField
    @ApiModelProperty("文件唯一标识")
    @NotEmpty(message = "文件唯一标识不为空")
    @Length(min = 1,max = 50)
    private String fileId;
}
